TryPop Method

Task Parallel System.Threading

Attempts to pop and return the object at the top of the ConcurrentStack<(Of <(T>)>).

Namespace:  System.Collections.Concurrent
Assembly:  System.Threading (in System.Threading.dll)

Syntax

Visual Basic (Declaration)
Public Function TryPop ( _
	<OutAttribute> ByRef result As T _
) As Boolean
C#
public bool TryPop(
	out T result
)

Parameters

result
Type: T %
When this method returns, if the operation was successful, result contains the object removed. If no object was available to be removed, the value is unspecified.

Return Value

true if an element was removed and returned from the top of the ConcurrentStack<(Of <(T>)>) succesfully; otherwise, false.

See Also